/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package sonia.golf.view;

//~--- non-JDK imports --------------------------------------------------------

import android.app.Activity;
import android.widget.Toast;


/**
 *
 * @author Sebastian Sdorra
 */
public abstract class AbstractGolfView implements GolfView
{

  /**
   * Constructs ...
   *
   *
   * @param activity
   */
  public AbstractGolfView(Activity activity)
  {
    this.activity = activity;
  }

  //~--- methods --------------------------------------------------------------

  /**
   * Method description
   *
   */
  public void release()
  {

    // do nothing
  }

  /**
   * Method description
   *
   *
   * @param messageId
   */
  protected void sendToastMessage(int messageId)
  {
    CharSequence message = getText(messageId);

    Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
  }

  //~--- get methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @param id
   * @param args
   *
   * @return
   */
  protected CharSequence getText(int id, Object... args)
  {
    return activity.getResources().getString(id, args);
  }

  //~--- fields ---------------------------------------------------------------

  /** Field description */
  protected Activity activity;
}
